package bpce.Entry;

import plugin.bpce.modelo.ConfiguracaoModelo;
import coppeer.cell.Cell;
import coppeer.cell.Entry;

public class ConfiguracaoNovoResultEntry implements Entry {

	private static final long serialVersionUID = -7420039930353611608L;
	private ConfiguracaoModelo configuracao;
	private boolean propagate = true;
	private String agente;

	public boolean afterPropagation() {
		return false;
	}

	public boolean beforePropagation() {
		if (propagate){
			propagate = false;
			return true;
		} else return false;
	}

	public Entry generatePropagation(Cell neighbor) {
		return this;
	}

	public long getPropagationLease(Cell neighbor) {
		return 10000;
	}

	public boolean matches(Entry template) {
		try{			
			ConfiguracaoNovoResultEntry ce = (ConfiguracaoNovoResultEntry) template;
			
			if (this.agente.equalsIgnoreCase(ce.getAgente()))
				return true;
			
			return false;
		}catch(Exception e){
			return false;
		}
	}

	public ConfiguracaoModelo getConfiguracao() {
		return configuracao;
	}

	public void setConfiguracao(ConfiguracaoModelo configuracao) {
		this.configuracao = configuracao;
	}

	public String getAgente() {
		return agente;
	}

	public void setAgente(String agente) {
		this.agente = agente;
	}

}
